package com.demo.morning;

/**
 * @ClassName abstarct关键字
 * @Description TODO
 * @Author tianqinglong
 * @Date 10:52 2022/7/6
 * @Version 1.0
 **/
abstract class M{
    void test(){}
    public abstract void test2();
}
class MC extends M{

    @Override
    public void test2() {
        System.out.println("MC test2");
    }
}

public class abstarct关键字 {
    public static void main(String[] args) {
        M mc = new MC();
        mc.test2();

        M m=new M(){
            @Override
            public void test2() {
                System.out.println("M test2");
            }
        };
        m.test2();
    }
}
